package com.chdwmp.product.pay.ali;

import com.chdwmp.product.constant.ApplicationProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class AlipayConfig {

    @Autowired
    ApplicationProperties applicationProperties;


    public String getAppID() {
        return applicationProperties.ALIPAY_APPID;
    }
    public String getNotifyUrl () {
        return applicationProperties.ALIPAY_NOTIFY_URL;
    }
    public String getCharset () {
        return "utf-8";
    }
    public String getSignType () {
        return "RSA2";
    }

    /**
     * 合作身份者ID，签约账号，以2088开头由16位纯数字组成的字符串
     * 查看地址：https://openhome.alipay.com/platform/keyManage.htm?keyType=partner
     */
    public String getPartner () {
        return applicationProperties.ALIPAY_PID;
    }
    /**
     * 商户的私钥,需要PKCS8格式
     * RSA公私钥生成：https://doc.open.alipay.com/doc2/detail.htm?spm=a219a.7629140.0.0.nBDxfy&treeId=58&articleId=103242&docType=1
     */
    public String getPrivateKey () {
        return applicationProperties.ALIPAY_PRIVATE_KEY;
    }
    /**
     * 支付宝的公钥
     * 查看地址：https://openhome.alipay.com/platform/keyManage.htm?keyType=partner
     */
    public String getAlipayPublicKey () {
        return applicationProperties.ALIPAY_PUBLIC_KEY;
    }

    public String getAlipayPrePayUrl () {
        return applicationProperties.ALIPAY_PRE_PAY_URL;
    }

    public String getAlipayTradeCloseUrl() {
        return applicationProperties.ALIPAY_TRADE_CLOSE_URL;
    }
    public String getAlipayGateWayApiUrl () {
        return applicationProperties.ALIPAY_GATEWAY_API_URL;
    }
    public String getReturnUrl () {
        return applicationProperties.ALIPAY_RETURN_URL;
    }

    public String getQuitUrl() {
        return applicationProperties.ALIPAY_QUIT_URL;
    }
    public String getTradQueryUrl() {
        return applicationProperties.ALIPAY_TRADE_QUERY_URL;

    }
}
